import java.util.ArrayList;

public class Card implements Comparable<Card> {
	Rank rank;
	Colour colour;

	public Card(Rank r, Colour c) {
		rank = r;
		colour = c;
	}

	public String toString() {
		String Rankname = rank.name();
		String Colourname = colour.name();
		Rankname = Rankname.replaceFirst("r", "");
		return capitalize(Rankname).concat(" ").concat(capitalize(Colourname));
	}

	private String capitalize(String line) {
		return Character.toUpperCase(line.charAt(0)) + line.substring(1);
	}

	public int compareTo(Card secCard) {

		return rank.compareTo(secCard.rank);
	}

	static String downCardList(ArrayList<Card> cards) {
		StringBuilder sb = new StringBuilder();
		for (Card c : cards) {
			sb.append(c).append(" | ");
		}
		return sb.toString();
	}
}
